﻿using System;
using Autofac;
using DDD.Commont;
using MagicWorld.DDD.Domain.Entity;
using MagicWorld.DDD.Domain.Service;
using MagicWorld.DDD.Domain.Types;

namespace ConsoleApp
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            AutofacContainerBuilder.Build(builder => builder.RegisterModule(new MagicWorldModules()));
            using var scope = AutofacContainerBuilder.Container.BeginLifetimeScope();
            var combataService = scope.Resolve<ICombatService>();
            var player = PlayerFactory.Create("断浪", PlayerClass.DragonKnight);
            var monster = MonsterFactory.Create(MonsterClass.Dragoon);
            combataService.PerformAttack(player, monster);
            Console.WriteLine($"Dragoon:{monster.Health.Value}");
        }
    }
}